I’m just new to PagerDuty, and I’m trying to develop a tool for my organization that will let users trigger an incident manually, but also have a sort of monitoring tool that will constantly check these incidents and once they’ve been acknowledged, an email would be sent to the user who submitted it. I’m kind of lost on which API to use, since it says I should use the REST API if human interaction is needed, but use the Events API for monitoring tools. Is it possible to use a combination of both in my code? For reference, I’m using Python 3.
Thank you in advance.
Should I use Events API v2 or REST API?
Hi Jose,
The Events API and the REST API are both powerful tools for different things.
The Events API can be used to send trigger, acknowledge, and resolve events to a specific integration key.
The REST API, on the other hand, uses a global, or user-specific API key, and has a much wider use case, including adding users, creating services, and updating schedules.
I recommend taking a look at our REST API documentation as well as our Events API documentation to see which to use when.
Hi Josef,
Thanks for answering and for providing those links. I’ll read up on them, and in any case if I still have some doubts I might reply here again.
Our best practices would steer you to the use of the REST API since it sounds like your use case is low volume incidents without the need for intelligent processing or routing of events. Take a look at the pdpyras library for a simple way to work with our APIs!
Doug
Where do you draw the line for “low volume incidents”? The incidents are triggered manually as well as the acknowledgments, so I was thinking of storing the triggered incidents ID somewhere, and then with a timed process, check each one’s status, and if acknowledged, it’s removed from wherever we store it, and then we notify the user who submitted it.
Since these incidents are being triggered manually (i.e. not by a monitoring tool that may be sending many events), I would agree with Doug here, that the REST API is probably the way to go.
The benefit of using the REST API is that it will give you access to a lot more possible actions. With the events API, you’re limited to triggering, acknowledging, or resolving an alert.
Josef
10’s-100’s an hour would be very low volume.
You can also have webhooks sent someplace for nearly all of the key events that take place in an incidents lifecycle and process these in your tool accordingly. Here’s a quick overview of what’s available today: https://developer.pagerduty.com/docs/webhooks/v2-overview/#webhook-types
Doug
I think we receive more than 100 incidents per hour, but I will have to take a closer look, and talk with some of the managers. If we do end up have a high volume of incidents, then I should look more into the Events API correct? And thank you for the webhooks link!
Yes, the Events API would be the other option, also provides you with the ability to do more things like routing, grouping, suppression, etc. before an actual PagerDuty Incident is created.